package cc.messcat.entity.fupin;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import cc.messcat.common.util.DateHelper;
import cc.messcat.entity.system.McUser;

/**
 * 走访记录
 *
 * @author Administrator
 */
@Entity
@Table(name = "visit_recd")
public class VisitRecd {
    @Id
    @GeneratedValue
    private Long id;
    
    @Column(name="create_time")
    private Date createTime;
    /**
     * 基本情况
     */
    @ManyToOne
	@JoinColumn(name="PID")
	private PoorFamily poorFamily;//关联的贫困户
//    @ManyToOne
//	@JoinColumn(name="FID")
//	private Family family;//家庭成员户主
    @Column(name = "TARGET",length=1000)
    private String target;//走访目的
    @Column(name = "CONTENT" ,length=1000)
    private String content;//走访描述
    @Column(name = "REMARKS",length=1000)
    private String remarks;//走访备注
    @Column(name = "ACCESSORY_Url",length=2048)
    private String accessoryUrl;//走访附件 多个用
    @Column(name = "ACCTOTAL")
    private String accTotal;//附件个数
    
    
    /**
     * 其他
     */
    @Column(name = "IS_DEL")
    private String isDel;//删除   默认0 1为删除
    @JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
 	@ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
 	@JoinColumn(name = "EDITTOR")
 	private McUser edittor;//编辑人
	@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
 	@ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
 	@JoinColumn(name = "ADDTOR")
 	private McUser addtor;//添加人
    @Column(name = "ADD_TIME")
    @JsonFormat(pattern = DateHelper.DATE_COMMON_FORMAT, timezone = "GMT+8")
    @DateTimeFormat(pattern = DateHelper.DATE_COMMON_FORMAT)
    private Date addTime;//添加时间（走访时间）
    @JsonFormat(pattern = DateHelper.DATE_COMMON_FORMAT, timezone = "GMT+8")
    @DateTimeFormat(pattern = DateHelper.DATE_COMMON_FORMAT)
    @Column(name = "UP_TIME")
    private Date upTime;//编辑时间
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public PoorFamily getPoorFamily() {
		return poorFamily;
	}
	public void setPoorFamily(PoorFamily poorFamily) {
		this.poorFamily = poorFamily;
	}
	public String getTarget() {
		return target;
	}
	public void setTarget(String target) {
		this.target = target;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getRemarks() {
		return remarks;
	}
	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	public String getAccessoryUrl() {
		return accessoryUrl;
	}
	public void setAccessoryUrl(String accessoryUrl) {
		this.accessoryUrl = accessoryUrl;
	}
	public String getIsDel() {
		return isDel;
	}
	public void setIsDel(String isDel) {
		this.isDel = isDel;
	}
	public Date getAddTime() {
		return addTime;
	}
	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}
	public Date getUpTime() {
		return upTime;
	}
	public void setUpTime(Date upTime) {
		this.upTime = upTime;
	}
	public McUser getEdittor() {
		return edittor;
	}
	public void setEdittor(McUser edittor) {
		this.edittor = edittor;
	}
	public McUser getAddtor() {
		return addtor;
	}
	public void setAddtor(McUser addtor) {
		this.addtor = addtor;
	}
	public String getAccTotal() {
		return accTotal;
	}
	public void setAccTotal(String accTotal) {
		this.accTotal = accTotal;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	
//	public Family getFamily() {
//		return family;
//	}
//	public void setFamily(Family family) {
//		this.family = family;
//	}
}
